{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "90e2984c-75b3-47f9-bf4b-f186e87dd7f0",
   "metadata": {
    "tags": []
   },
   "source": [
    "# 安装配置 MMGeneration 环境"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6fc1c686-1267-4503-b9e4-bcb188a7f974",
   "metadata": {
    "tags": []
   },
   "source": [
    "## 下载安装Pytorch、mmcv -full（大约需要两分钟）"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9292cac8-6c77-4282-bae4-1f484bfcf653",
   "metadata": {},
   "source": [
    "> 提示：以下代码运行时，若长时间运行卡着不动，可重启 kernel 后重新运行一遍"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "2fef57fc-d5f0-4cd0-a134-1f025c15439f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple\n",
      "Looking in links: https://download.pytorch.org/whl/cu113/torch_stable.html\n",
      "Requirement already satisfied: install in /environment/miniconda3/lib/python3.7/site-packages (1.3.5)\n",
      "Requirement already satisfied: torch==1.10.1+cu113 in /environment/miniconda3/lib/python3.7/site-packages (1.10.1+cu113)\n",
      "Requirement already satisfied: torchvision==0.11.2+cu113 in /environment/miniconda3/lib/python3.7/site-packages (0.11.2+cu113)\n",
      "Requirement already satisfied: torchaudio==0.10.1+cu113 in /environment/miniconda3/lib/python3.7/site-packages (0.10.1+cu113)\n",
      "Requirement already satisfied: typing-extensions in /environment/miniconda3/lib/python3.7/site-packages (from torch==1.10.1+cu113) (4.0.1)\n",
      "Requirement already satisfied: pillow!=8.3.0,>=5.3.0 in /environment/miniconda3/lib/python3.7/site-packages (from torchvision==0.11.2+cu113) (8.4.0)\n",
      "Requirement already satisfied: numpy in /environment/miniconda3/lib/python3.7/site-packages (from torchvision==0.11.2+cu113) (1.21.4)\n",
      "Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple\n",
      "Looking in links: https://download.openmmlab.com/mmcv/dist/cu113/torch1.10.0/index.html\n",
      "Collecting mmcv-full==1.6.0\n",
      "  Downloading https://download.openmmlab.com/mmcv/dist/cu113/torch1.10.0/mmcv_full-1.6.0-cp37-cp37m-manylinux1_x86_64.whl (53.5 MB)\n",
      "\u001b[K     |████████████████████████████████| 53.5 MB 230 kB/s  eta 0:00:01     |███████████████████▉            | 33.3 MB 6.9 MB/s eta 0:00:03     |████████████████████▍           | 34.0 MB 6.9 MB/s eta 0:00:03     |█████████████████████           | 34.9 MB 6.9 MB/s eta 0:00:03     |█████████████████████▎          | 35.5 MB 6.9 MB/s eta 0:00:03     |██████████████████████▉         | 38.3 MB 6.9 MB/s eta 0:00:03     |████████████████████████▎       | 40.7 MB 6.9 MB/s eta 0:00:02     |█████████████████████████▎      | 42.3 MB 6.9 MB/s eta 0:00:02\n",
      "\u001b[?25hRequirement already satisfied: opencv-python>=3 in /environment/miniconda3/lib/python3.7/site-packages (from mmcv-full==1.6.0) (4.5.4.60)\n",
      "Requirement already satisfied: addict in /environment/miniconda3/lib/python3.7/site-packages (from mmcv-full==1.6.0) (2.4.0)\n",
      "Requirement already satisfied: yapf in /environment/miniconda3/lib/python3.7/site-packages (from mmcv-full==1.6.0) (0.31.0)\n",
      "Requirement already satisfied: pyyaml in /environment/miniconda3/lib/python3.7/site-packages (from mmcv-full==1.6.0) (6.0)\n",
      "Requirement already satisfied: Pillow in /environment/miniconda3/lib/python3.7/site-packages (from mmcv-full==1.6.0) (8.4.0)\n",
      "Requirement already satisfied: numpy in /environment/miniconda3/lib/python3.7/site-packages (from mmcv-full==1.6.0) (1.21.4)\n",
      "Requirement already satisfied: packaging in /environment/miniconda3/lib/python3.7/site-packages (from mmcv-full==1.6.0) (21.3)\n",
      "Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /environment/miniconda3/lib/python3.7/site-packages (from packaging->mmcv-full==1.6.0) (3.0.6)\n",
      "Installing collected packages: mmcv-full\n",
      "  Attempting uninstall: mmcv-full\n",
      "    Found existing installation: mmcv-full 1.7.1\n",
      "    Uninstalling mmcv-full-1.7.1:\n",
      "      Successfully uninstalled mmcv-full-1.7.1\n",
      "Successfully installed mmcv-full-1.6.0\n"
     ]
    }
   ],
   "source": [
    "# 先在控制台安装pip\n",
    "# sudo apt install python3-pip\n",
    "# sudo apt-get install libglib2.0-0\n",
    "# pip3 install --upgrade pip\n",
    "# 安装 Pytorch\n",
    "!pip3 install install torch==1.10.1+cu113 torchvision==0.11.2+cu113 torchaudio==0.10.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html\n",
    "\n",
    "# 安装 mmcv -full\n",
    "!pip install mmcv-full==1.6.0 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.10.0/index.html\n",
    "# !pip install mmcv==2.0.0 -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.0/index.html"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bc540885-f779-4768-94cd-a3da173069ef",
   "metadata": {},
   "source": [
    "## 安装其它工具包(大约需要一分钟)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "54fd8470-feb9-4f52-8aaf-257876516d29",
   "metadata": {
    "collapsed": true,
    "jupyter": {
     "outputs_hidden": true
    },
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple\n",
      "Requirement already satisfied: ipywidgets in /environment/miniconda3/lib/python3.7/site-packages (7.6.5)\n",
      "Requirement already satisfied: tqdm in /environment/miniconda3/lib/python3.7/site-packages (4.61.2)\n",
      "Requirement already satisfied: imageio-ffmpeg in /environment/miniconda3/lib/python3.7/site-packages (0.4.9)\n",
      "Requirement already satisfied: ninja in /environment/miniconda3/lib/python3.7/site-packages (1.11.1.1)\n",
      "Requirement already satisfied: matplotlib in /environment/miniconda3/lib/python3.7/site-packages (3.5.0)\n",
      "Requirement already satisfied: numpy in /environment/miniconda3/lib/python3.7/site-packages (1.21.4)\n",
      "Requirement already satisfied: opencv-python in /environment/miniconda3/lib/python3.7/site-packages (4.5.4.60)\n",
      "Requirement already satisfied: prettytable in /environment/miniconda3/lib/python3.7/site-packages (3.7.0)\n",
      "Requirement already satisfied: ipython>=4.0.0 in /environment/miniconda3/lib/python3.7/site-packages (from ipywidgets) (7.30.1)\n",
      "Requirement already satisfied: nbformat>=4.2.0 in /environment/miniconda3/lib/python3.7/site-packages (from ipywidgets) (5.4.0)\n",
      "Requirement already satisfied: traitlets>=4.3.1 in /environment/miniconda3/lib/python3.7/site-packages (from ipywidgets) (5.1.1)\n",
      "Requirement already satisfied: ipykernel>=4.5.1 in /environment/miniconda3/lib/python3.7/site-packages (from ipywidgets) (6.6.0)\n",
      "Requirement already satisfied: jupyterlab-widgets>=1.0.0 in /environment/miniconda3/lib/python3.7/site-packages (from ipywidgets) (1.0.2)\n",
      "Requirement already satisfied: widgetsnbextension~=3.5.0 in /environment/miniconda3/lib/python3.7/site-packages (from ipywidgets) (3.5.2)\n",
      "Requirement already satisfied: ipython-genutils~=0.2.0 in /environment/miniconda3/lib/python3.7/site-packages (from ipywidgets) (0.2.0)\n",
      "Requirement already satisfied: debugpy<2.0,>=1.0.0 in /environment/miniconda3/lib/python3.7/site-packages (from ipykernel>=4.5.1->ipywidgets) (1.5.1)\n",
      "Requirement already satisfied: argcomplete>=1.12.3 in /environment/miniconda3/lib/python3.7/site-packages (from ipykernel>=4.5.1->ipywidgets) (1.12.3)\n",
      "Requirement already satisfied: matplotlib-inline<0.2.0,>=0.1.0 in /environment/miniconda3/lib/python3.7/site-packages (from ipykernel>=4.5.1->ipywidgets) (0.1.3)\n",
      "Requirement already satisfied: tornado<7.0,>=4.2 in /environment/miniconda3/lib/python3.7/site-packages (from ipykernel>=4.5.1->ipywidgets) (6.1)\n",
      "Requirement already satisfied: jupyter-client<8.0 in /environment/miniconda3/lib/python3.7/site-packages (from ipykernel>=4.5.1->ipywidgets) (7.1.0)\n",
      "Requirement already satisfied: importlib-metadata<5 in /environment/miniconda3/lib/python3.7/site-packages (from ipykernel>=4.5.1->ipywidgets) (4.8.2)\n",
      "Requirement already satisfied: typing-extensions>=3.6.4 in /environment/miniconda3/lib/python3.7/site-packages (from importlib-metadata<5->ipykernel>=4.5.1->ipywidgets) (4.0.1)\n",
      "Requirement already satisfied: zipp>=0.5 in /environment/miniconda3/lib/python3.7/site-packages (from importlib-metadata<5->ipykernel>=4.5.1->ipywidgets) (3.6.0)\n",
      "Requirement already satisfied: pexpect>4.3 in /environment/miniconda3/lib/python3.7/site-packages (from ipython>=4.0.0->ipywidgets) (4.8.0)\n",
      "Requirement already satisfied: setuptools>=18.5 in /environment/miniconda3/lib/python3.7/site-packages (from ipython>=4.0.0->ipywidgets) (52.0.0.post20210125)\n",
      "Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /environment/miniconda3/lib/python3.7/site-packages (from ipython>=4.0.0->ipywidgets) (3.0.23)\n",
      "Requirement already satisfied: backcall in /environment/miniconda3/lib/python3.7/site-packages (from ipython>=4.0.0->ipywidgets) (0.2.0)\n",
      "Requirement already satisfied: pickleshare in /environment/miniconda3/lib/python3.7/site-packages (from ipython>=4.0.0->ipywidgets) (0.7.5)\n",
      "Requirement already satisfied: jedi>=0.16 in /environment/miniconda3/lib/python3.7/site-packages (from ipython>=4.0.0->ipywidgets) (0.17.0)\n",
      "Requirement already satisfied: pygments in /environment/miniconda3/lib/python3.7/site-packages (from ipython>=4.0.0->ipywidgets) (2.10.0)\n",
      "Requirement already satisfied: decorator in /environment/miniconda3/lib/python3.7/site-packages (from ipython>=4.0.0->ipywidgets) (5.1.0)\n",
      "Requirement already satisfied: parso>=0.7.0 in /environment/miniconda3/lib/python3.7/site-packages (from jedi>=0.16->ipython>=4.0.0->ipywidgets) (0.8.3)\n",
      "Requirement already satisfied: nest-asyncio>=1.5 in /environment/miniconda3/lib/python3.7/site-packages (from jupyter-client<8.0->ipykernel>=4.5.1->ipywidgets) (1.5.4)\n",
      "Requirement already satisfied: python-dateutil>=2.1 in /environment/miniconda3/lib/python3.7/site-packages (from jupyter-client<8.0->ipykernel>=4.5.1->ipywidgets) (2.8.2)\n",
      "Requirement already satisfied: entrypoints in /environment/miniconda3/lib/python3.7/site-packages (from jupyter-client<8.0->ipykernel>=4.5.1->ipywidgets) (0.3)\n",
      "Requirement already satisfied: jupyter-core>=4.6.0 in /environment/miniconda3/lib/python3.7/site-packages (from jupyter-client<8.0->ipykernel>=4.5.1->ipywidgets) (4.9.1)\n",
      "Requirement already satisfied: pyzmq>=13 in /environment/miniconda3/lib/python3.7/site-packages (from jupyter-client<8.0->ipykernel>=4.5.1->ipywidgets) (22.3.0)\n",
      "Requirement already satisfied: fastjsonschema in /environment/miniconda3/lib/python3.7/site-packages (from nbformat>=4.2.0->ipywidgets) (2.16.1)\n",
      "Requirement already satisfied: jsonschema>=2.6 in /environment/miniconda3/lib/python3.7/site-packages (from nbformat>=4.2.0->ipywidgets) (4.2.1)\n",
      "Requirement already satisfied: importlib-resources>=1.4.0 in /environment/miniconda3/lib/python3.7/site-packages (from jsonschema>=2.6->nbformat>=4.2.0->ipywidgets) (5.4.0)\n",
      "Requirement already satisfied: attrs>=17.4.0 in /environment/miniconda3/lib/python3.7/site-packages (from jsonschema>=2.6->nbformat>=4.2.0->ipywidgets) (21.2.0)\n",
      "Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /environment/miniconda3/lib/python3.7/site-packages (from jsonschema>=2.6->nbformat>=4.2.0->ipywidgets) (0.18.0)\n",
      "Requirement already satisfied: ptyprocess>=0.5 in /environment/miniconda3/lib/python3.7/site-packages (from pexpect>4.3->ipython>=4.0.0->ipywidgets) (0.7.0)\n",
      "Requirement already satisfied: wcwidth in /environment/miniconda3/lib/python3.7/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython>=4.0.0->ipywidgets) (0.2.5)\n",
      "Requirement already satisfied: six>=1.5 in /environment/miniconda3/lib/python3.7/site-packages (from python-dateutil>=2.1->jupyter-client<8.0->ipykernel>=4.5.1->ipywidgets) (1.16.0)\n",
      "Requirement already satisfied: notebook>=4.4.1 in /environment/miniconda3/lib/python3.7/site-packages (from widgetsnbextension~=3.5.0->ipywidgets) (6.4.6)\n",
      "Requirement already satisfied: jinja2 in /environment/miniconda3/lib/python3.7/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (3.0.3)\n",
      "Requirement already satisfied: Send2Trash>=1.8.0 in /environment/miniconda3/lib/python3.7/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (1.8.0)\n",
      "Requirement already satisfied: argon2-cffi in /environment/miniconda3/lib/python3.7/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (21.2.0)\n",
      "Requirement already satisfied: terminado>=0.8.3 in /environment/miniconda3/lib/python3.7/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (0.12.1)\n",
      "Requirement already satisfied: nbconvert in /environment/miniconda3/lib/python3.7/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (7.0.0)\n",
      "Requirement already satisfied: prometheus-client in /environment/miniconda3/lib/python3.7/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (0.12.0)\n",
      "Requirement already satisfied: pyparsing>=2.2.1 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib) (3.0.6)\n",
      "Requirement already satisfied: packaging>=20.0 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib) (21.3)\n",
      "Requirement already satisfied: setuptools-scm>=4 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib) (6.3.2)\n",
      "Requirement already satisfied: kiwisolver>=1.0.1 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib) (1.3.2)\n",
      "Requirement already satisfied: fonttools>=4.22.0 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib) (4.28.3)\n",
      "Requirement already satisfied: cycler>=0.10 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib) (0.11.0)\n",
      "Requirement already satisfied: pillow>=6.2.0 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib) (8.4.0)\n",
      "Requirement already satisfied: tomli>=1.0.0 in /environment/miniconda3/lib/python3.7/site-packages (from setuptools-scm>=4->matplotlib) (1.2.2)\n",
      "Requirement already satisfied: argon2-cffi-bindings in /environment/miniconda3/lib/python3.7/site-packages (from argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (21.2.0)\n",
      "Requirement already satisfied: cffi>=1.0.1 in /environment/miniconda3/lib/python3.7/site-packages (from argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (1.14.6)\n",
      "Requirement already satisfied: pycparser in /environment/miniconda3/lib/python3.7/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (2.20)\n",
      "Requirement already satisfied: MarkupSafe>=2.0 in /environment/miniconda3/lib/python3.7/site-packages (from jinja2->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (2.0.1)\n",
      "Requirement already satisfied: nbclient>=0.5.0 in /environment/miniconda3/lib/python3.7/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (0.5.9)\n",
      "Requirement already satisfied: tinycss2 in /environment/miniconda3/lib/python3.7/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (1.1.1)\n",
      "Requirement already satisfied: bleach in /environment/miniconda3/lib/python3.7/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (4.1.0)\n",
      "Requirement already satisfied: defusedxml in /environment/miniconda3/lib/python3.7/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (0.7.1)\n",
      "Requirement already satisfied: pandocfilters>=1.4.1 in /environment/miniconda3/lib/python3.7/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (1.5.0)\n",
      "Requirement already satisfied: lxml in /environment/miniconda3/lib/python3.7/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (4.9.1)\n",
      "Requirement already satisfied: mistune<3,>=2.0.3 in /environment/miniconda3/lib/python3.7/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (2.0.4)\n",
      "Requirement already satisfied: jupyterlab-pygments in /environment/miniconda3/lib/python3.7/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (0.1.2)\n",
      "Requirement already satisfied: beautifulsoup4 in /environment/miniconda3/lib/python3.7/site-packages (from nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (4.11.1)\n",
      "Requirement already satisfied: soupsieve>1.2 in /environment/miniconda3/lib/python3.7/site-packages (from beautifulsoup4->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (2.3.2.post1)\n",
      "Requirement already satisfied: webencodings in /environment/miniconda3/lib/python3.7/site-packages (from bleach->nbconvert->notebook>=4.4.1->widgetsnbextension~=3.5.0->ipywidgets) (0.5.1)\n"
     ]
    }
   ],
   "source": [
    "# 安装其它工具包\n",
    "!pip install ipywidgets tqdm imageio-ffmpeg ninja matplotlib numpy opencv-python prettytable -i https://pypi.tuna.tsinghua.edu.cn/simple"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "81b9def2-c3cf-4669-84a7-5c5f6bf62353",
   "metadata": {},
   "source": [
    "## 下载 MMGeneration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "c05a79c9-0378-4b27-aa39-aa26bb24f0c0",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 但是现在不用再下载了\n",
    "# 删掉原有的mmgeneration文件夹（如有）\n",
    "!rm -rf mmgeneration"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "d12b6693-3b9f-46ce-b100-a9ae78c0beb2",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "正克隆到 'mmgeneration'...\n",
      "remote: 对象计数中: 8156, 完成.\u001b[K\n",
      "remote: 压缩对象中: 100% (2285/2285), 完成.\u001b[K\n",
      "remote: Total 8156 (delta 5851), reused 7992 (delta 5704)\u001b[K\n",
      "接收对象中: 100% (8156/8156), 3.27 MiB | 1.02 MiB/s, 完成.\n",
      "处理 delta 中: 100% (5851/5851), 完成.\n"
     ]
    }
   ],
   "source": [
    "# 从github上下载最新的 mmgeneration 源代码\n",
    "# !git clone https://github.com/open-mmlab/mmgeneration.git\n",
    "# 因为github这个东西老是出问题。。。\n",
    "!git clone https://gitclone.com/github.com/open-mmlab/mmgeneration.git"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9751c831-6fed-4556-85c3-88974daf452b",
   "metadata": {},
   "source": [
    "## 安装 MMGeneration （大约需要2分钟）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "36401674-1e98-433f-8a21-bac8933a3272",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 进入 mmgeneration 主目录\n",
    "import os\n",
    "os.chdir('mmgeneration')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "89438292-eefd-4789-93e6-2e407678cdf5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple\n",
      "Collecting mmcls\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/1f/7d/19588f57c22f4053ca2db92c691fbea556899f407fe7bb03ed42b37f07ef/mmcls-0.25.0-py2.py3-none-any.whl (648 kB)\n",
      "\u001b[K     |████████████████████████████████| 648 kB 57.6 MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: ninja in /environment/miniconda3/lib/python3.7/site-packages (from -r requirements/runtime.txt (line 2)) (1.11.1.1)\n",
      "Requirement already satisfied: numpy in /environment/miniconda3/lib/python3.7/site-packages (from -r requirements/runtime.txt (line 3)) (1.21.4)\n",
      "Requirement already satisfied: prettytable in /environment/miniconda3/lib/python3.7/site-packages (from -r requirements/runtime.txt (line 4)) (3.7.0)\n",
      "Requirement already satisfied: scikit-image in /environment/miniconda3/lib/python3.7/site-packages (from -r requirements/runtime.txt (line 5)) (0.19.0)\n",
      "Requirement already satisfied: scipy in /environment/miniconda3/lib/python3.7/site-packages (from -r requirements/runtime.txt (line 6)) (1.7.3)\n",
      "Requirement already satisfied: tqdm in /environment/miniconda3/lib/python3.7/site-packages (from -r requirements/runtime.txt (line 7)) (4.61.2)\n",
      "Requirement already satisfied: yapf in /environment/miniconda3/lib/python3.7/site-packages (from -r requirements/runtime.txt (line 8)) (0.31.0)\n",
      "Collecting codecov\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/af/02/18785edcdf6266cdd6c6dc7635f1cbeefd9a5b4c3bb8aff8bd681e9dd095/codecov-2.1.13-py2.py3-none-any.whl (16 kB)\n",
      "Requirement already satisfied: flake8 in /environment/miniconda3/lib/python3.7/site-packages (from -r requirements/tests.txt (line 2)) (3.8.4)\n",
      "Collecting interrogate\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/85/57/aa8632d8ff7c1b612abf0093b4dce7a1f74de852c548dbd99e1b858cf60f/interrogate-1.5.0-py3-none-any.whl (45 kB)\n",
      "\u001b[K     |████████████████████████████████| 45 kB 38.6 MB/s eta 0:00:01\n",
      "\u001b[?25hCollecting isort==4.3.21\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e5/b0/c121fd1fa3419ea9bfd55c7f9c4fedfec5143208d8c7ad3ce3db6c623c21/isort-4.3.21-py2.py3-none-any.whl (42 kB)\n",
      "\u001b[K     |████████████████████████████████| 42 kB 21.4 MB/s eta 0:00:01\n",
      "\u001b[?25hCollecting pytest\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/df/d0/e192c4275aecabf74faa1aacd75ef700091913236ec78b1a98f62a2412ee/pytest-7.4.2-py3-none-any.whl (324 kB)\n",
      "\u001b[K     |████████████████████████████████| 324 kB 60.9 MB/s eta 0:00:01\n",
      "\u001b[?25hCollecting pytest-runner\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/42/7b/1cec26caae4bf44bb9911e1119d5d1a35171571e100b728a2ccd8719a3b1/pytest_runner-6.0.0-py3-none-any.whl (7.2 kB)\n",
      "Requirement already satisfied: matplotlib>=3.1.0 in /environment/miniconda3/lib/python3.7/site-packages (from mmcls->-r requirements/runtime.txt (line 1)) (3.5.0)\n",
      "Requirement already satisfied: packaging in /environment/miniconda3/lib/python3.7/site-packages (from mmcls->-r requirements/runtime.txt (line 1)) (21.3)\n",
      "Requirement already satisfied: fonttools>=4.22.0 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->-r requirements/runtime.txt (line 1)) (4.28.3)\n",
      "Requirement already satisfied: setuptools-scm>=4 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->-r requirements/runtime.txt (line 1)) (6.3.2)\n",
      "Requirement already satisfied: python-dateutil>=2.7 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->-r requirements/runtime.txt (line 1)) (2.8.2)\n",
      "Requirement already satisfied: cycler>=0.10 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->-r requirements/runtime.txt (line 1)) (0.11.0)\n",
      "Requirement already satisfied: pyparsing>=2.2.1 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->-r requirements/runtime.txt (line 1)) (3.0.6)\n",
      "Requirement already satisfied: kiwisolver>=1.0.1 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->-r requirements/runtime.txt (line 1)) (1.3.2)\n",
      "Requirement already satisfied: pillow>=6.2.0 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->-r requirements/runtime.txt (line 1)) (8.4.0)\n",
      "Requirement already satisfied: six>=1.5 in /environment/miniconda3/lib/python3.7/site-packages (from python-dateutil>=2.7->matplotlib>=3.1.0->mmcls->-r requirements/runtime.txt (line 1)) (1.16.0)\n",
      "Requirement already satisfied: tomli>=1.0.0 in /environment/miniconda3/lib/python3.7/site-packages (from setuptools-scm>=4->matplotlib>=3.1.0->mmcls->-r requirements/runtime.txt (line 1)) (1.2.2)\n",
      "Requirement already satisfied: setuptools in /environment/miniconda3/lib/python3.7/site-packages (from setuptools-scm>=4->matplotlib>=3.1.0->mmcls->-r requirements/runtime.txt (line 1)) (52.0.0.post20210125)\n",
      "Requirement already satisfied: importlib-metadata in /environment/miniconda3/lib/python3.7/site-packages (from prettytable->-r requirements/runtime.txt (line 4)) (4.8.2)\n",
      "Requirement already satisfied: wcwidth in /environment/miniconda3/lib/python3.7/site-packages (from prettytable->-r requirements/runtime.txt (line 4)) (0.2.5)\n",
      "Requirement already satisfied: imageio>=2.4.1 in /environment/miniconda3/lib/python3.7/site-packages (from scikit-image->-r requirements/runtime.txt (line 5)) (2.13.3)\n",
      "Requirement already satisfied: PyWavelets>=1.1.1 in /environment/miniconda3/lib/python3.7/site-packages (from scikit-image->-r requirements/runtime.txt (line 5)) (1.2.0)\n",
      "Requirement already satisfied: tifffile>=2019.7.26 in /environment/miniconda3/lib/python3.7/site-packages (from scikit-image->-r requirements/runtime.txt (line 5)) (2021.11.2)\n",
      "Requirement already satisfied: networkx>=2.2 in /environment/miniconda3/lib/python3.7/site-packages (from scikit-image->-r requirements/runtime.txt (line 5)) (2.6.3)\n",
      "Requirement already satisfied: requests>=2.7.9 in /environment/miniconda3/lib/python3.7/site-packages (from codecov->-r requirements/tests.txt (line 1)) (2.24.0)\n",
      "Collecting coverage\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e2/c0/73f139794c742840b9ab88e2e17fe14a3d4668a166ff95d812ac66c0829d/coverage-7.2.7-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (225 kB)\n",
      "\u001b[K     |████████████████████████████████| 225 kB 63.9 MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: chardet<4,>=3.0.2 in /environment/miniconda3/lib/python3.7/site-packages (from requests>=2.7.9->codecov->-r requirements/tests.txt (line 1)) (3.0.4)\n",
      "Requirement already satisfied: idna<3,>=2.5 in /environment/miniconda3/lib/python3.7/site-packages (from requests>=2.7.9->codecov->-r requirements/tests.txt (line 1)) (2.10)\n",
      "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /environment/miniconda3/lib/python3.7/site-packages (from requests>=2.7.9->codecov->-r requirements/tests.txt (line 1)) (1.25.11)\n",
      "Requirement already satisfied: certifi>=2017.4.17 in /environment/miniconda3/lib/python3.7/site-packages (from requests>=2.7.9->codecov->-r requirements/tests.txt (line 1)) (2021.5.30)\n",
      "Requirement already satisfied: pycodestyle<2.7.0,>=2.6.0a1 in /environment/miniconda3/lib/python3.7/site-packages (from flake8->-r requirements/tests.txt (line 2)) (2.6.0)\n",
      "Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in /environment/miniconda3/lib/python3.7/site-packages (from flake8->-r requirements/tests.txt (line 2)) (0.6.1)\n",
      "Requirement already satisfied: pyflakes<2.3.0,>=2.2.0 in /environment/miniconda3/lib/python3.7/site-packages (from flake8->-r requirements/tests.txt (line 2)) (2.2.0)\n",
      "Requirement already satisfied: click>=7.1 in /environment/miniconda3/lib/python3.7/site-packages (from interrogate->-r requirements/tests.txt (line 3)) (7.1.2)\n",
      "Collecting py\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/f6/f0/10642828a8dfb741e5f3fbaac830550a518a775c7fff6f04a007259b0548/py-1.11.0-py2.py3-none-any.whl (98 kB)\n",
      "\u001b[K     |████████████████████████████████| 98 kB 61.6 MB/s eta 0:00:01\n",
      "\u001b[?25hRequirement already satisfied: colorama in /environment/miniconda3/lib/python3.7/site-packages (from interrogate->-r requirements/tests.txt (line 3)) (0.4.4)\n",
      "Requirement already satisfied: attrs in /environment/miniconda3/lib/python3.7/site-packages (from interrogate->-r requirements/tests.txt (line 3)) (21.2.0)\n",
      "Requirement already satisfied: toml in /environment/miniconda3/lib/python3.7/site-packages (from interrogate->-r requirements/tests.txt (line 3)) (0.10.2)\n",
      "Requirement already satisfied: tabulate in /environment/miniconda3/lib/python3.7/site-packages (from interrogate->-r requirements/tests.txt (line 3)) (0.8.7)\n",
      "Collecting iniconfig\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ef/a6/62565a6e1cf69e10f5727360368e451d4b7f58beeac6173dc9db836a5b46/iniconfig-2.0.0-py3-none-any.whl (5.9 kB)\n",
      "Requirement already satisfied: pluggy<2.0,>=0.12 in /environment/miniconda3/lib/python3.7/site-packages (from pytest->-r requirements/tests.txt (line 5)) (1.0.0)\n",
      "Collecting exceptiongroup>=1.0.0rc8\n",
      "  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ad/83/b71e58666f156a39fb29417e4c8ca4bc7400c0dd4ed9e8842ab54dc8c344/exceptiongroup-1.1.3-py3-none-any.whl (14 kB)\n",
      "Requirement already satisfied: typing-extensions>=3.6.4 in /environment/miniconda3/lib/python3.7/site-packages (from importlib-metadata->prettytable->-r requirements/runtime.txt (line 4)) (4.0.1)\n",
      "Requirement already satisfied: zipp>=0.5 in /environment/miniconda3/lib/python3.7/site-packages (from importlib-metadata->prettytable->-r requirements/runtime.txt (line 4)) (3.6.0)\n",
      "Installing collected packages: py, iniconfig, exceptiongroup, coverage, pytest-runner, pytest, mmcls, isort, interrogate, codecov\n",
      "  Attempting uninstall: isort\n",
      "    Found existing installation: isort 5.10.1\n",
      "    Uninstalling isort-5.10.1:\n",
      "      Successfully uninstalled isort-5.10.1\n",
      "Successfully installed codecov-2.1.13 coverage-7.2.7 exceptiongroup-1.1.3 iniconfig-2.0.0 interrogate-1.5.0 isort-4.3.21 mmcls-0.25.0 py-1.11.0 pytest-7.4.2 pytest-runner-6.0.0\n",
      "Using pip 21.1.3 from /environment/miniconda3/lib/python3.7/site-packages/pip (python 3.7)\n",
      "Non-user install because site-packages writeable\n",
      "Created temporary directory: /tmp/pip-ephem-wheel-cache-0wjlpafz\n",
      "Created temporary directory: /tmp/pip-req-tracker-pnylj7qv\n",
      "Initialized build tracking at /tmp/pip-req-tracker-pnylj7qv\n",
      "Created build tracker: /tmp/pip-req-tracker-pnylj7qv\n",
      "Entered build tracker: /tmp/pip-req-tracker-pnylj7qv\n",
      "Created temporary directory: /tmp/pip-install-ecxv8gz4\n",
      "Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple\n",
      "Obtaining file:///home/featurize/MMGeneration/mmgeneration\n",
      "  Added file:///home/featurize/MMGeneration/mmgeneration to build tracker '/tmp/pip-req-tracker-pnylj7qv'\n",
      "    Running setup.py (path:/home/featurize/MMGeneration/mmgeneration/setup.py) egg_info for package from file:///home/featurize/MMGeneration/mmgeneration\n",
      "    Created temporary directory: /tmp/pip-pip-egg-info-kdv7wz90\n",
      "    Running command python setup.py egg_info\n",
      "    running egg_info\n",
      "    creating /tmp/pip-pip-egg-info-kdv7wz90/mmgen.egg-info\n",
      "    writing /tmp/pip-pip-egg-info-kdv7wz90/mmgen.egg-info/PKG-INFO\n",
      "    writing dependency_links to /tmp/pip-pip-egg-info-kdv7wz90/mmgen.egg-info/dependency_links.txt\n",
      "    writing requirements to /tmp/pip-pip-egg-info-kdv7wz90/mmgen.egg-info/requires.txt\n",
      "    writing top-level names to /tmp/pip-pip-egg-info-kdv7wz90/mmgen.egg-info/top_level.txt\n",
      "    writing manifest file '/tmp/pip-pip-egg-info-kdv7wz90/mmgen.egg-info/SOURCES.txt'\n",
      "    reading manifest template 'MANIFEST.in'\n",
      "    warning: no files found matching 'mmgen/model-index.yml'\n",
      "    warning: no files found matching '*.py' under directory 'mmgen/configs'\n",
      "    warning: no files found matching '*.yml' under directory 'mmgen/configs'\n",
      "    warning: no files found matching '*.sh' under directory 'mmgen/tools'\n",
      "    warning: no files found matching '*.py' under directory 'mmgen/tools'\n",
      "    warning: no files found matching 'mmgen/VERSION'\n",
      "    warning: no files found matching 'mmgen/.mim/model-index.yml'\n",
      "    warning: no files found matching 'mmgen/.mim/demo/*/*'\n",
      "    warning: no files found matching '*.py' under directory 'mmgen/.mim/configs'\n",
      "    warning: no files found matching '*.yml' under directory 'mmgen/.mim/configs'\n",
      "    warning: no files found matching '*.sh' under directory 'mmgen/.mim/tools'\n",
      "    warning: no files found matching '*.py' under directory 'mmgen/.mim/tools'\n",
      "    writing manifest file '/tmp/pip-pip-egg-info-kdv7wz90/mmgen.egg-info/SOURCES.txt'\n",
      "  Source in /home/featurize/MMGeneration/mmgeneration has version 0.7.2, which satisfies requirement mmgen==0.7.2 from file:///home/featurize/MMGeneration/mmgeneration\n",
      "  Removed mmgen==0.7.2 from file:///home/featurize/MMGeneration/mmgeneration from build tracker '/tmp/pip-req-tracker-pnylj7qv'\n",
      "Requirement already satisfied: mmcls in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (0.25.0)\n",
      "Requirement already satisfied: ninja in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (1.11.1.1)\n",
      "Requirement already satisfied: numpy in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (1.21.4)\n",
      "Requirement already satisfied: prettytable in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (3.7.0)\n",
      "Requirement already satisfied: scikit-image in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (0.19.0)\n",
      "Requirement already satisfied: scipy in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (1.7.3)\n",
      "Requirement already satisfied: tqdm in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (4.61.2)\n",
      "Requirement already satisfied: yapf in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (0.31.0)\n",
      "Requirement already satisfied: codecov in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (2.1.13)\n",
      "Requirement already satisfied: flake8 in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (3.8.4)\n",
      "Requirement already satisfied: interrogate in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (1.5.0)\n",
      "Requirement already satisfied: isort==4.3.21 in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (4.3.21)\n",
      "Requirement already satisfied: pytest in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (7.4.2)\n",
      "Requirement already satisfied: pytest-runner in /environment/miniconda3/lib/python3.7/site-packages (from mmgen==0.7.2) (6.0.0)\n",
      "Requirement already satisfied: coverage in /environment/miniconda3/lib/python3.7/site-packages (from codecov->mmgen==0.7.2) (7.2.7)\n",
      "Requirement already satisfied: requests>=2.7.9 in /environment/miniconda3/lib/python3.7/site-packages (from codecov->mmgen==0.7.2) (2.24.0)\n",
      "Requirement already satisfied: certifi>=2017.4.17 in /environment/miniconda3/lib/python3.7/site-packages (from requests>=2.7.9->codecov->mmgen==0.7.2) (2021.5.30)\n",
      "Requirement already satisfied: idna<3,>=2.5 in /environment/miniconda3/lib/python3.7/site-packages (from requests>=2.7.9->codecov->mmgen==0.7.2) (2.10)\n",
      "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /environment/miniconda3/lib/python3.7/site-packages (from requests>=2.7.9->codecov->mmgen==0.7.2) (1.25.11)\n",
      "Requirement already satisfied: chardet<4,>=3.0.2 in /environment/miniconda3/lib/python3.7/site-packages (from requests>=2.7.9->codecov->mmgen==0.7.2) (3.0.4)\n",
      "Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in /environment/miniconda3/lib/python3.7/site-packages (from flake8->mmgen==0.7.2) (0.6.1)\n",
      "Requirement already satisfied: pycodestyle<2.7.0,>=2.6.0a1 in /environment/miniconda3/lib/python3.7/site-packages (from flake8->mmgen==0.7.2) (2.6.0)\n",
      "Requirement already satisfied: pyflakes<2.3.0,>=2.2.0 in /environment/miniconda3/lib/python3.7/site-packages (from flake8->mmgen==0.7.2) (2.2.0)\n",
      "Requirement already satisfied: importlib-metadata in /environment/miniconda3/lib/python3.7/site-packages (from flake8->mmgen==0.7.2) (4.8.2)\n",
      "Requirement already satisfied: zipp>=0.5 in /environment/miniconda3/lib/python3.7/site-packages (from importlib-metadata->flake8->mmgen==0.7.2) (3.6.0)\n",
      "Requirement already satisfied: typing-extensions>=3.6.4 in /environment/miniconda3/lib/python3.7/site-packages (from importlib-metadata->flake8->mmgen==0.7.2) (4.0.1)\n",
      "Requirement already satisfied: click>=7.1 in /environment/miniconda3/lib/python3.7/site-packages (from interrogate->mmgen==0.7.2) (7.1.2)\n",
      "Requirement already satisfied: toml in /environment/miniconda3/lib/python3.7/site-packages (from interrogate->mmgen==0.7.2) (0.10.2)\n",
      "Requirement already satisfied: tabulate in /environment/miniconda3/lib/python3.7/site-packages (from interrogate->mmgen==0.7.2) (0.8.7)\n",
      "Requirement already satisfied: colorama in /environment/miniconda3/lib/python3.7/site-packages (from interrogate->mmgen==0.7.2) (0.4.4)\n",
      "Requirement already satisfied: py in /environment/miniconda3/lib/python3.7/site-packages (from interrogate->mmgen==0.7.2) (1.11.0)\n",
      "Requirement already satisfied: attrs in /environment/miniconda3/lib/python3.7/site-packages (from interrogate->mmgen==0.7.2) (21.2.0)\n",
      "Requirement already satisfied: packaging in /environment/miniconda3/lib/python3.7/site-packages (from mmcls->mmgen==0.7.2) (21.3)\n",
      "Requirement already satisfied: matplotlib>=3.1.0 in /environment/miniconda3/lib/python3.7/site-packages (from mmcls->mmgen==0.7.2) (3.5.0)\n",
      "Requirement already satisfied: pillow>=6.2.0 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->mmgen==0.7.2) (8.4.0)\n",
      "Requirement already satisfied: kiwisolver>=1.0.1 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->mmgen==0.7.2) (1.3.2)\n",
      "Requirement already satisfied: pyparsing>=2.2.1 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->mmgen==0.7.2) (3.0.6)\n",
      "Requirement already satisfied: fonttools>=4.22.0 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->mmgen==0.7.2) (4.28.3)\n",
      "Requirement already satisfied: cycler>=0.10 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->mmgen==0.7.2) (0.11.0)\n",
      "Requirement already satisfied: python-dateutil>=2.7 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->mmgen==0.7.2) (2.8.2)\n",
      "Requirement already satisfied: setuptools-scm>=4 in /environment/miniconda3/lib/python3.7/site-packages (from matplotlib>=3.1.0->mmcls->mmgen==0.7.2) (6.3.2)\n",
      "Requirement already satisfied: six>=1.5 in /environment/miniconda3/lib/python3.7/site-packages (from python-dateutil>=2.7->matplotlib>=3.1.0->mmcls->mmgen==0.7.2) (1.16.0)\n",
      "Requirement already satisfied: tomli>=1.0.0 in /environment/miniconda3/lib/python3.7/site-packages (from setuptools-scm>=4->matplotlib>=3.1.0->mmcls->mmgen==0.7.2) (1.2.2)\n",
      "Requirement already satisfied: setuptools in /environment/miniconda3/lib/python3.7/site-packages (from setuptools-scm>=4->matplotlib>=3.1.0->mmcls->mmgen==0.7.2) (52.0.0.post20210125)\n",
      "Requirement already satisfied: wcwidth in /environment/miniconda3/lib/python3.7/site-packages (from prettytable->mmgen==0.7.2) (0.2.5)\n",
      "Requirement already satisfied: pluggy<2.0,>=0.12 in /environment/miniconda3/lib/python3.7/site-packages (from pytest->mmgen==0.7.2) (1.0.0)\n",
      "Requirement already satisfied: exceptiongroup>=1.0.0rc8 in /environment/miniconda3/lib/python3.7/site-packages (from pytest->mmgen==0.7.2) (1.1.3)\n",
      "Requirement already satisfied: iniconfig in /environment/miniconda3/lib/python3.7/site-packages (from pytest->mmgen==0.7.2) (2.0.0)\n",
      "Requirement already satisfied: imageio>=2.4.1 in /environment/miniconda3/lib/python3.7/site-packages (from scikit-image->mmgen==0.7.2) (2.13.3)\n",
      "Requirement already satisfied: networkx>=2.2 in /environment/miniconda3/lib/python3.7/site-packages (from scikit-image->mmgen==0.7.2) (2.6.3)\n",
      "Requirement already satisfied: tifffile>=2019.7.26 in /environment/miniconda3/lib/python3.7/site-packages (from scikit-image->mmgen==0.7.2) (2021.11.2)\n",
      "Requirement already satisfied: PyWavelets>=1.1.1 in /environment/miniconda3/lib/python3.7/site-packages (from scikit-image->mmgen==0.7.2) (1.2.0)\n",
      "Created temporary directory: /tmp/pip-unpack-wrwhas_o\n",
      "Installing collected packages: mmgen\n",
      "  Running setup.py develop for mmgen\n",
      "    Running command /environment/miniconda3/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '\"'\"'/home/featurize/MMGeneration/mmgeneration/setup.py'\"'\"'; __file__='\"'\"'/home/featurize/MMGeneration/mmgeneration/setup.py'\"'\"';f = getattr(tokenize, '\"'\"'open'\"'\"', open)(__file__) if os.path.exists(__file__) else io.StringIO('\"'\"'from setuptools import setup; setup()'\"'\"');code = f.read().replace('\"'\"'\\r\\n'\"'\"', '\"'\"'\\n'\"'\"');f.close();exec(compile(code, __file__, '\"'\"'exec'\"'\"'))' develop --no-deps\n",
      "    running develop\n",
      "    running egg_info\n",
      "    creating mmgen.egg-info\n",
      "    writing mmgen.egg-info/PKG-INFO\n",
      "    writing dependency_links to mmgen.egg-info/dependency_links.txt\n",
      "    writing requirements to mmgen.egg-info/requires.txt\n",
      "    writing top-level names to mmgen.egg-info/top_level.txt\n",
      "    writing manifest file 'mmgen.egg-info/SOURCES.txt'\n",
      "    reading manifest template 'MANIFEST.in'\n",
      "    warning: no files found matching 'mmgen/model-index.yml'\n",
      "    warning: no files found matching '*.py' under directory 'mmgen/configs'\n",
      "    warning: no files found matching '*.yml' under directory 'mmgen/configs'\n",
      "    warning: no files found matching '*.sh' under directory 'mmgen/tools'\n",
      "    warning: no files found matching '*.py' under directory 'mmgen/tools'\n",
      "    warning: no files found matching 'mmgen/VERSION'\n",
      "    warning: no files found matching 'mmgen/.mim/demo/*/*'\n",
      "    writing manifest file 'mmgen.egg-info/SOURCES.txt'\n",
      "    running build_ext\n",
      "    Creating /environment/miniconda3/lib/python3.7/site-packages/mmgen.egg-link (link to .)\n",
      "    Adding mmgen 0.7.2 to easy-install.pth file\n",
      "\n",
      "    Installed /home/featurize/MMGeneration/mmgeneration\n",
      "Successfully installed mmgen-0.7.2\n",
      "Removed build tracker: '/tmp/pip-req-tracker-pnylj7qv'\n"
     ]
    }
   ],
   "source": [
    "!pip install -r requirements.txt\n",
    "!pip install -v -e ."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "98578099-afa6-432c-8831-8635632a7a33",
   "metadata": {},
   "source": [
    "## 创建一些文件夹"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "dc434b4c-1ceb-4122-aee8-bcf52f46d23a",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 创建 outputs 文件夹，用于存放生成结果\n",
    "os.mkdir('outputs')\n",
    "\n",
    "# 创建 data 文件夹，用于存放图像数据集\n",
    "os.mkdir('data')\n",
    "\n",
    "# 创建 checkpoints 文件夹，用于存放模型权重文件\n",
    "os.mkdir('checkpoints')\n",
    "\n",
    "# 创建 work_dirs 文件夹，用于存放训练结果及趣味 demo 输出结果\n",
    "os.mkdir('work_dirs')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "92bd845d-d076-403e-8241-6faa44565fbb",
   "metadata": {},
   "source": [
    "## 检查是否安装成功"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "d87c61c2-a8bf-47d9-b9a8-4ca4e06b6a76",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "mmgen载入成功！\n"
     ]
    }
   ],
   "source": [
    "import torch, torchvision\n",
    "\n",
    "import mmcv\n",
    "\n",
    "from mmgen.apis import init_model, sample_unconditional_model\n",
    "\n",
    "print('mmgen载入成功！')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bc8e0c77-8434-4749-878c-c19ace15ede4",
   "metadata": {},
   "source": [
    "如果代码没有中断报错，输出`mmgen载入成功！`，则说明 MMGeneration 安装成功！"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
